﻿
Imports std

Partial Public Class node
    Public Shared Function add_set_int64(ByVal id As Int64) As _do(Of [set](Of Int64), Boolean)
        Return Function(ByRef x As [set](Of Int64)) As Boolean
                   assert(Not x Is Nothing)
                   If x.find(id) = x.end() Then
                       assert(x.insert(id) <> x.end())
                       Return True
                   Else
                       Return False
                   End If
               End Function
    End Function

    Public Shared Function remove_set_int64(ByVal id As Int64) As _do(Of [set](Of Int64), Boolean)
        Return Function(ByRef x As [set](Of Int64)) As Boolean
                   Return Not x Is Nothing AndAlso x.erase(id)
               End Function
    End Function

    Public Shared Function add_vector_int64(ByVal id As Int64) As _do(Of vector(Of Int64), Boolean)
        Return Function(ByRef x As vector(Of Int64)) As Boolean
                   assert(Not x Is Nothing)
                   Return x.push_back(id)
               End Function
    End Function
End Class
